<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>微信支付</title>
    <style>
        html,body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            background-color: rgb(51,51,51);
        }
        .main {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-direction: column;
        }
        .main img{
            width: 280px;
            margin-top: 20px
        }
        .main .notice{
            width: 250px;
            text-align: center;
            color: #ffffff;
            font-size: .8rem;
            margin-top: 15px;
            background-color: #232323;
            border-radius: 100px;
            -moz-border-radius: 100px;
            -webkit-border-radius: 100px;
            box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
            -moz-box-shadow: inset 0 5px 10px -5px #191919,0 1px 0 0 #444;
            -webkit-box-shadow: inset 0 5px 10px -5px #191919, 0 1px 0 0 #444;
            padding: 15px;
        }
        .main .title{
            color: #ffffff;
            font-size: 1.2rem
        }
    </style>
</head>
<body>
<div class="main">
    <div class="title">欢乐户外-活动报名扫码支付</div>
    <img src="{$code}" />
    <div class="notice">活动名称: 《{$title}》</div>
    <div class="notice">请使用微信扫描上面二维码进行支付</div>
</div>
<script src="//cdn.bootcss.com/jquery/3.3.0/jquery.min.js"></script>
<script>
    $(function(){
        checkPayResult()
    })
    function checkPayResult () {
        $.ajax({
            url: '/activity-api/activity.h5.check.wechat.pay?order_no={$orderNo}',
            headers: {
                'client-type': 'h5'
            },
            type: "get"
        }).done(function(e) {
            console.log(e)
            if (e.code === 10000) {
                window.location.replace('/order/detail/{$orderNo}')
            } else {
                setTimeout(function() {
                    checkPayResult()
                },1000)
            }
        })
    }
</script>
</body>
</html>